<!doctype html>
[#escape x as (x)!?html]
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>领导信箱 - ${site.seoTitle} - Powered by JPROCMS</title>
  <meta name="keywords" content="领导信箱">
  [#include '../includes/common_res.html'/]
</head>
<body>
[#assign shadowNav=true/]
[#include '../includes/header.html'/]
<div class="container">
  <div class="row">
      <!--左侧--->
      [#include '../includes/inc_letter_left.html'/]
      <!--右侧--->
      <div class="col-9 content-area p-5">
        <div class="py-1 border-bottom">
          当前月总信件数量:<span id="letterTotal"></span>
          <span class="ml-2">当前月办理信件:<span id="letterReplyCount" ></span> </span>
        </div>
        <div class="py-1 border-bottom">
        [@ZDictList type='cms_letter_type'; list]
          <a href="${ZParamsJoin('letter','letter','type')}" class="btn btn-sm[#if !Params.type??] btn-secondary[#else] btn-link text-reset[/#if]">全部类别</a>
          [#list list as dict]
            <a href="${ZParamsJoin('letter','letter', 'type', dict.value)}"
              class="btn btn-sm [#if Params.type! == dict.value]btn-secondary[#else]btn-link text-reset[/#if]">${dict.label}</a>
          [/#list]
        [/@ZDictList]
        </div>
        [@ZLetterPage type=Params.type title=Params.title  pageSize='10';pageResult]
          <ul class="list-unstyled">
            [#list pageResult.list as letter]
              <li class="mt-3 pb-3 border-bottom position-relative">
                <div class="d-flex align-items-center">
                  <div class="badge badge-info mr-2">${letter.typeName}</div>
                  <div class="flex-grow-1 text-truncate col-6"><a href="${base}/letter/${letter.id?c}" class="text-reset stretched-link">${letter.title!ZSubstring(g.letterText,100,'...')}</a></div>
                  <div class="text-black-50 col-2 ">
                    <div> ${letter.replyDeptName}</div>
                  </div>
                  <div class="text-black-50 col-4 ">
                    <div ><i class="ml-2 far fa-clock"></i> ${ZFormat(letter.replyDate, 'yyyy-MM-dd HH:mm:ss')}</div>
                  </div>
                </div>
                
              </li>
            [/#list]
          </ul>
          [#include '../includes/inc_page.html'/]
        [/@ZLetterPage]
      </div>
    </div>
  </div>
</div>
<script>
  $(function () {
    axios.get('${api}/letter/statistic/count').then(function (response) {
      $('#letterTotal').text(response.data.data.createCount);
      $('#letterReplyCount').text(response.data.data.finishCount);
    });
  });
</script>
[#include '../includes/footer.html'/]
[#include '../includes/inc_msg.html'/]
</body>
</html>
[/#escape]
